//
// Created by user on 2025/7/17.
//

#ifndef HELLOC_PROCESS_CPP
#define HELLOC_PROCESS_CPP

#include "systemc"
#include <iostream>

using namespace std;
using namespace sc_core;

SC_MODULE(Process) {
    sc_clock clk;
    SC_CTOR(Process): clk("clk",1,SC_SEC){
        SC_METHOD(method);
        SC_THREAD(thread);
        SC_CTHREAD(cthread,clk);
    }

    void method(void){
        cout << "method triggered @ " << sc_time_stamp() << endl;
        next_trigger(sc_time(1,SC_SEC));
    }

    void thread(void) {
        cout << "thread triggered @ " << sc_time_stamp() << endl;
        wait(1, SC_SEC);
    }

    void cthread(){
        while(true){
            cout<< "cthread triggered @ " << sc_time_stamp() << endl;
            wait();
        }
    }

};




#endif //HELLOC_PROCESS_CPP
